// pages/detail-playlist/index.js
import { getSongMenu } from "../../../service/api_music"

Page({

  data: {
    huayu: [],
    gufeng: [],
    oumei: [],
    liuxing: []
  },

  onLoad: function (options) {
    this.getPageData()
  },

  onUnload: function () {

  },

  // 网络请求
  getPageData: function () {
    getSongMenu("华语").then(res => {
      this.setData({ huayu: res.playlists })
    }),
    getSongMenu("古风").then(res => {
      this.setData({ gufeng: res.playlists })
    }),
    getSongMenu("欧美").then(res => {
      this.setData({ oumei: res.playlists })
    }),
    getSongMenu("流行").then(res => {
      this.setData({ liuxing: res.playlists })
    })
  }
})